Session Storage

Characteristic

Short description

The session storage is a database where PlanToursRequests can be stored.

Use

The stored requests in the session storage offer the possibility to use ChangeToursRequests and ToursInExecutionRequests.

Detailed Consideration

Per default, PTV xServer provides an H2 database to store different states of a tour plan, the so-called session storage.

Stored objects

The session storage stores PlanToursRequest objects that are mapped to unique stored request IDs. The request IDs can be used in ChangeToursRequests to manipulate the existing tour plans. A ChangeToursRequest creates a new PlanToursRequest object and stores it in the session storage using a newly generated request ID. The requested changes are integrated into the input plan of the new PlanToursRequest. The original PlanToursRequest remains unchanged.

A stored request can be used in a ToursInExecutionRequest to calculate the estimated times of arrival based on the current positions of its vehiclesClosed. A ToursInExecutionRequest does not store a new request in the session storage, but it attaches routingClosed information to the original request. This routing information cannot explicitly be accessed via the PTV xServer API, but it is used internally to speed up the response time of subsequent ToursInExecutionRequests. Newly generated requests do not have any routing information attached.

A DataNotAvailableFault is thrown if a referenced stored request ID is invalid or if the corresponding request was deleted.

Lifetime of stored requests

Requests in the session storage cannot be deleted via the PTV xServer API. However, there are two general parameters in the PTV xServer configuration file to limit the life span of the stored requests. These parameters are core.session.retentionTime and core.session.cleanupInterval, see Server Configuration.

Each stored request has a time stamp containing its creation time. A ToursInExecutionRequest resets the time stamp of the corresponding stored request to the current server time. A cleanup task is started once after every cleanup interval and deletes all requests whose time stamps are older than the retention time.

Good to know

PTV xServer Database

The PTV xServer can be configured to use other databases apart from H2 if there is a jdbc driver for the desired database.

Technical Concept Change Tours
Integration Sample Changing Stored Tours
Administrator's Guide Database Configuration